home *** CD-ROM | disk | FTP | other *** search
- section Code,Code_c
-
- include df0:AGA-SourceCode/HardWareEquates
-
- start bset #1,$bfe001 low pass filter off
-
- move.l #Playfield.1,d0
- lea Play.1(pc),a0
-
- bsr Init.Copper
-
- move.l #Playfield.2+16*2,d0
- lea Play.2(pc),a0
-
- bsr Init.Copper
-
- move.l 4.w,a6
- jsr -132(a6) turn off multitasking
-
- lea $dff000,a6
- move.w intenar(a6),ints save system interrupt status
- move.w #$3fef,intena(a6)
- move.w #$c010,intena(a6) enable copper interrupt
-
- vpwait move.l vposr(a6),d0 get vertical beam position
- and.l #$1ff00,d0
- lsr.l #8,d0
- cmp.w #312,d0 wait for bottom line
- bne.s vpwait before disabling sprite DMA
-
- move.w #$03ff,dmacon(a6) DMA off
-
- move.l $14.w,olddbz division-by-zero exception handler
- move.l #rteins,$14.w set to rte instruction
-
-
- *
- * SET SCREEN SIZE ETC
- *
- move.w #$0610,bplcon0(a6) initialise screen
- move.w #$2c81,diwstrt(a6)
- move.w #$f4c1,diwstop(a6)
- move.w #$38,ddfstrt(a6)
- move.w #$d8,ddfstop(a6)
- move.w #$00,bplcon1(a6)
- move.w #$24,bplcon2(a6)
- move.w #40*3-8,bpl1mod(a6)
- move.w #40*3-8,bpl2mod(a6)
-
-
- *
- * SET THE NEW COPPER LOCATION
- *
- move.l 4.w,a6
- lea grafname(pc),a1
- moveq #0,d0
- jsr -552(a6) openlibrary
- tst.l d0
- beq end
- move.l d0,gfxbase
- move.l d0,a6
- jsr -456(a6) ownblitter
-
- move.l gfxbase(pc),a1
- move.l 38(a1),oldcopper
-
-
- lea $dff000,a6
- move.l copper1(pc),cop1lch(a6)
- move.w d0,copjmp1(a6)
- move.w #$83c0,dmacon(a6) DMA on (bitplane, copper, blitter)
-
-
- *
- * INITIALISE LEVEL 3 INTERRUPT
- *
-
- move.l $6c.w,old
- move.l #level3,$6c.w
-
- *****************************************
- * MAIN LOOP *
- *****************************************
-
- loop
- clr.w nextframe
- wait tst.w nextframe
- beq.s wait
-
- bsr Scroll.Planes
-
- btst #6,$bfe001
- bne.s loop
-
-
-
- *
- * EXIT ROUTINE
- *
-
-
- wait2 btst #6,dmaconr(a6) wait for blitter to finish
- bne.s wait2
-
- move.l old(pc),$6c.w
-
- move.l oldcopper(pc),cop1lch(a6)
-
- move.w #$8030,dmacon(a6) DMA on (sprite, disk)
- move.w ints(pc),d0
- ori.w #$c000,d0 set SET and INTEN bits
- move.w d0,intena(a6) restore system interrupt status
-
- move.l olddbz(pc),$14.w restore division-by-zero exception handler
-
- move.l gfxbase(pc),a6
- jsr -462(a6) disownblitter
- move.l gfxbase(pc),a1
- move.l 4.w,a6
- jsr -414(a6) closelibrary
-
- end move.l 4.w,a6
- jsr -138(a6) turn on multitasking
-
- bclr #1,$bfe001 low pass filter on
- moveq #0,d0
- rts
-
-
-
- *********************
- * LEVEL 3 INTERRUPT *
- *********************
-
-
- level3 movem.l d0-d7/a0-a6,-(sp)
- move.w #$10,intreq(a6)
-
- move.w #1,nextframe
-
- movem.l (sp)+,d0-d7/a0-a6
- rteins rte
-
-
- *************************************************
-
- Scroll.Planes
- move.w PlayA(pc),d0
-
- tst.w PlA.Dir
- bmi.s Check.LeftA
-
- addq.w #1,d0
- cmp.w #255,d0
- bne.s Set.Values
- move.w #-1,PlA.dir
- bra.s Set.Values
-
- Check.LeftA
- subq.w #1,d0
- tst.w d0
- bne.s Set.Values
- move.w #1,PlA.dir
-
- Set.Values
- move.w d0,PlayA
- move.w #255,d3
- sub.w d0,d3
-
- move.w d0,d1
- move.w d1,d2
-
- and.w #$0003,d0
- and.w #$003c,d1
- and.w #$00c0,d2
-
- lsl.w #8,d0
- lsr.w #2,d1
- lsl.w #4,d2
-
- or.w d2,d0
- or.w d1,d0
-
- move.w d3,d4
- move.w d4,d5
-
- and.w #$0003,d3
- and.w #$003c,d4
- and.w #$00c0,d5
-
- lsl.w #8,d3
- lsl.w #4,d3
- lsl.w #2,d4
- lsl.w #8,d5
-
- or.w d5,d0
- or.w d4,d0
- or.w d3,d0
-
- move.w d0,bplcon1(a6)
- rts
-
- *************************************************
-
-
- init.copper
- moveq #4-1,d1
- next.plane
- move.w d0,6(a0) save low word
- swap d0
- move.w d0,2(a0) save high word
- swap d0
- add.l #40,d0 next bitplane
- add.w #16,a0 update pointer to copper list
- dbra d1,next.plane
- rts
-
- ;""""""""""""""""""""""""""""""""""""""""
- ; " THE COPPER LIST "
- ; " "
- ; """""""""""""""""""
-
- copper.list.1
- dc.w $106,$0c40
-
- dc.w $180,$0
- dc.w $182,$820
- dc.w $184,$a42
- dc.w $186,$c60
- dc.w $188,$e82
- dc.w $18a,$ea4
- dc.w $18c,$ec6
- dc.w $18e,$ee8
- dc.w $190,$001
- dc.w $192,$007
- dc.w $194,$01a
- dc.w $196,$02e
- dc.w $198,$46f
- dc.w $19a,$69f
- dc.w $19c,$9cf
- dc.w $19e,$fff
-
- dc.w $106,$3420
-
- dc.w $180,$0
- dc.w $182,$558
- dc.w $184,$003
- dc.w $186,$114
- dc.w $188,$036
- dc.w $18a,$227
- dc.w $18c,$321
- dc.w $18e,$530
- dc.w $190,$461
- dc.w $192,$640
- dc.w $194,$861
- dc.w $196,$a71
- dc.w $198,$c93
- dc.w $19a,$eb4
- dc.w $19c,$fc5
- dc.w $19e,$fd9
-
- Play.1
- dc.w bpl1pth,0 8 bitplane display Dual Pf
- dc.w bpl1ptl,0
- Play.2
- dc.w bpl2pth,0
- dc.w bpl2ptl,0
- dc.w bpl3pth,0
- dc.w bpl3ptl,0
- dc.w bpl4pth,0
- dc.w bpl4ptl,0
- dc.w bpl5pth,0
- dc.w bpl5ptl,0
- dc.w bpl6pth,0
- dc.w bpl6ptl,0
- dc.w bpl7pth,0
- dc.w bpl7ptl,0
- dc.w bpl8pth,0
- dc.w bpl8ptl,0
-
- dc.w $01fc,$3
-
- dc.w $ff01,$fffe
-
- dc.w intreq,$8010
-
- dc.w $ffff,$fffe END
-
-
-
- *************
- * VARIABLES *
- *************
-
- PlayA dc.w 0
-
- copper1 dc.l copper.list.1
-
- olddbz dc.l 0
- oldcopper dc.l 0
- gfxbase dc.l 0
- ints dc.w 0
- old dc.l 0
- nextframe dc.w 0
-
- PlA.Dir dc.w 1
-
- grafname dc.b 'graphics.library',0
- even
-
-
- PlayField.1 incbin binary/PlayField1
- PlayField.2 incbin binary/Tut16
-
-